import 'package:hm_show_flutter/entity/goods.dart';

class GoodsListEntity {
	int errno;
	GoodsListData data;
	String errmsg;

	GoodsListEntity({this.errno, this.data, this.errmsg});

	GoodsListEntity.fromJson(Map<String, dynamic> json) {
		errno = json['errno'];
		data = json['data'] != null ? new GoodsListData.fromJson(json['data']) : null;
		errmsg = json['errmsg'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['errno'] = this.errno;
		if (this.data != null) {
      data['data'] = this.data.toJson();
    }
		data['errmsg'] = this.errmsg;
		return data;
	}
}

class GoodsListData {
	int total;
	int pages;
	int limit;
	int page;
	List<GoodsModel> xList;

	GoodsListData({this.total, this.pages, this.limit, this.page, this.xList});

	GoodsListData.fromJson(Map<String, dynamic> json) {
		total = json['total'];
		pages = json['pages'];
		limit = json['limit'];
		page = json['page'];
		if (json['list'] != null) {
			xList = new List<GoodsModel>();(json['list'] as List).forEach((v) { xList.add(new GoodsModel.fromJson(v)); });
		}
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['total'] = this.total;
		data['pages'] = this.pages;
		data['limit'] = this.limit;
		data['page'] = this.page;
		if (this.xList != null) {
      data['list'] =  this.xList.map((v) => v.toJson()).toList();
    }
		return data;
	}

}
